﻿#!/bin/bash

./settings_set.sh

SQL_CMD="mysql --user=root --password=$PWD asterisk"
$SQL_CMD -e "GRANT ALL ON *.* TO 'root'@'$IP_ALLOWED' IDENTIFIED BY '$PWD';"
$SQL_CMD -e "GRANT ALL ON *.* TO 'root'@'%' IDENTIFIED BY '$PWD';"
$SQL_CMD -e "show tables;"


/sbin/iptables -A INPUT -i eth0 -p tcp \
	--destination-port 3306 -j ACCEPT
/sbin/iptables -A INPUT -i eth0 -s $NETWORK -p tcp \
	--destination-port 3306 -j ACCEPT

service iptables save
service iptables restart

# chkconfig iptables off
reboot; exit
